#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
<<<<<<< HEAD
=======
    //
    scrollBar=new QScrollBar(this);
    spinBox=new QSpinBox(this);
    //横显、竖显
    scrollBar->setOrientation(Qt::Horizontal);
    //位置
    scrollBar->setGeometry(QRect(50,50,180,20));
    spinBox->setGeometry(QRect(50,90,100,25));
    //控制条宽度
    scrollBar->setPageStep(10);
    //scrollbar事件
    connect(scrollBar,
            SIGNAL(valueChanged(int)),
            spinBox,SLOT(setValue(int)));
    //spinbox事件
    connect(
            spinBox,
            SIGNAL(valueChanged(int)),
            scrollBar,SLOT(setValue(int))
            );
    //初始值
    scrollBar->setValue(50);
>>>>>>> fe23871b613890e3fa6a9cce9042a72eaced611b
}

MainWindow::~MainWindow()
{
    delete ui;
}
